#include <stdio.h>
int main()
{
    int a,b,sum=0;
    scanf("%d %d",&a,&b);
    for(int i=a;i<=b;i++){
        sum+=i;
        printf("%5d",i);
        if((i-a+1)%5==0&&i>a){
            printf("\n");
        }
    }
    if((b-a+1)%5!=0){
    	printf("\n");
	}
     printf("Sum = %d",sum);
    
    
    return 0;
}
